from get_data import *
import numpy as np

#定义一个卷积核
kernel = np.ones((5,5),np.uint8)

lowerbH = 60
lowerbS = 59
lowerbV = 97
upperbH = 142
upperbS = 208
upperbV = 179

def first_data(img):
    HSV = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    #cv2.imshow("2",HSV)
    img_target = cv2.inRange(HSV, (lowerbH, lowerbS, lowerbV), (upperbH, upperbS, upperbV))
    img_target = cv2.erode(img_target, kernel, iterations=1)
    #cv2.imshow("1",img_target)
    #cv2.waitKey()
    return img_target